<!DOCTYPE html>
<html lang='en'>

<head>
  <meta charset='UTF-8'>
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
  <title>Document</title>
</head>

<body>
  <h2>结果在控制台~~</h2>
  路径：<input type="text" id="input1">
  <br>
  <br>
  内容：<textarea name="" id="textarea1" cols="30" rows="10"></textarea>
  <br>
  <br>
  <button type="button" onclick="GET()">GET</button></button>
  <button type="button" onclick="PATCH()">PATCH</button></button>
  <button type="button" onclick="POST()">POST</button></button>
  <button type="button" onclick="DELETE()">DELETE</button></button>

  <script src="./public/js/jsonbin.min.js"></script>
  <!-- <script src="./jsonbin.min.js"></script> -->
  <script>
    let input1 = document.getElementById("input1")
    let textarea1 = document.getElementById("textarea1")

    const jsonbin = new JsonBin('zzwuweijun', 'cadcbc89-6ddd-4892-a490-cbd9f253a750')

    function GET() {
      jsonbin.get(input1.value).then(s => console.log(`GET`, s))
    }
    function PATCH() {
      jsonbin.patch(input1.value, textarea1.value ).then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, "undefined").then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, [32, 'jo', 'j3'] ).then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, {ll:324, pp:'djfi'}).then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, undefined).then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, "undefined").then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, null).then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, "null").then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, false).then(s => console.log(`PATCH`, s))
      // jsonbin.patch(input1.value, 1234).then(s => console.log(`PATCH`, s))
    }
    function POST() {
      jsonbin.post(input1.value, textarea1.value).then(s => console.log(`POST`, s))
    }
    function DELETE() {
      jsonbin.delete(input1.value).then(s => console.log(`DELETE`, s))
    }

    // 保存jsonbin
    // {kuaijiejian:[ { "message": "好的，那你等下拍下我给你的闲鱼链接，4.32那个就是了~~", "tag": "商品" }, { "message": "那你在闲鱼拍下吧，4.32那个就是了，到时我在这里给你资源", "tag": "拍下" }, { "message": "快速操作，“确认、对、收到”之类回复1，否则回复2", "tag": "快速" }, { "message": "来了么？给点什么反应都好~~", "tag": "来了" }, { "message": "是需要色色的吗？", "tag": "需求" }, { "message": "好的，请稍等~~", "tag": "稍等" }, { "message": "注意哦，页面刷新就没有了，需要保存链接~~", "tag": "保存" }, { "message": "https://www.123pan.com/s/gcpcjv-6oSXv.html", "tag": "址1" }, { "message": "上个地址不能打开的话，可以试试下面那个链接~", "tag": "地址" }, { "message": "https://jsrun.net/ca5Kp", "tag": "址2" }, { "message": "使用说明：你打开我给你的链接，是word文档，里面有链接，复制到浏览器打开就好", "tag": "说明" }, { "message": "收到了吗，收到请回复~~", "tag": "收到" }, { "message": "没办法，平台限制，只能这样偷偷着来了~~", "tag": "限制" } ]}
    
    // let jj = [
      //   { "message": "好的，那你等下拍下我给你的闲鱼链接，4.32那个就是了~~", "tag": "商品" },
      //   { "message": "那你在闲鱼拍下吧，4.32那个就是了，到时我在这里给你资源", "tag": "拍下" },
      //   { "message": "快速操作，“确认、对、收到”之类回复1，否则回复2", "tag": "快速" },
      //   { "message": "来了么？给点什么反应都好~~", "tag": "来了" },
      //   { "message": "是需要色色的吗？", "tag": "需求" },
      //   { "message": "好的，请稍等~~", "tag": "稍等" },
      //   { "message": "注意哦，页面刷新就没有了，需要保存链接~~", "tag": "保存" },
      //   { "message": "https://www.123pan.com/s/gcpcj-6oSXv.html", "tag": "址1" },
      //   { "message": "上个地址不能打开的话，可以试试下面那个链接~", "tag": "地址" },
      //   { "message": "https://jsru.net/ca5Kp", "tag": "址2" },
      //   { "message": "使用说明：你打开我给你的链接，是word文档，里面有链接，复制到浏览器打开就好", "tag": "说明" },
      //   { "message": "收到了吗，收到请回复~~", "tag": "收到" },
      //   { "message": "没办法，平台限制，只能这样偷偷着来了~~", "tag": "限制" }
      // ]
  </script>

</body>

</html>